#ifndef BILLPRINTERAPP_H
#define BILLPRINTERAPP_H

#include <QMainWindow>
#include <QPrinter>
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#include <QPainter>
#include <QFileDialog>
#include <QMap>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include "billtemplate.h"
#include "templateeditordialog.h"

class BillPrinterApp : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit BillPrinterApp(QWidget *parent = nullptr);
    ~BillPrinterApp();
    
private slots:
    void newTemplate();
    void loadTemplate();
    void saveTemplate();
    void updateDataInputs();
    void previewPrint();
    void directPrint();
    void printBill(QPrinter* printer);
    
private:
    void initUI();
    
    BillTemplate templateObj;
    QMap<QString, QString> dataValues;
    
    QLabel* templateLabel;
    QWidget* dataInputWidget;
    QVBoxLayout* dataInputLayout;
};

#endif // BILLPRINTERAPP_H
